/*
    SUSAN® - Sole of Unix Save ANything

   Copyright (C) 2016-2019 Skyatlas co. ltd

   
*/
#ifndef BAREOS_LIB_JCR_H_
#define BAREOS_LIB_JCR_H_
class JobControlRecord;

void WriteStateFile(char* dir, const char* progname, int port);
void RegisterJobEndCallback(JobControlRecord* jcr,
                            void JobEndCb(JobControlRecord* jcr, void*),
                            void* ctx);
void LockJobs();
void UnlockJobs();

void LockJcrChain();
void UnlockJcrChain();

JobControlRecord* jcr_walk_start();
JobControlRecord* jcr_walk_next(JobControlRecord* prev_jcr);
void JcrWalkEnd(JobControlRecord* jcr);
int JobCount();
void InitJcrChain();
void CleanupJcrChain();

#endif  // BAREOS_LIB_JCR_H_
